package Tree;

public class ClueTree {
    public static  TreeNode BuildTree(int n)
    {
        TreeNode root = build(1, n);
        return  root;
    }

    private static TreeNode build(int start , int end) {
        if(start>end)
        {
            return null;
        }
        int val = (start+end)/2;
        TreeNode root = new TreeNode(val);
         root.left = build(start, val- 1);
         root.right = build(val+1,end);
        return root;
    }

    public static void main(String[] args) {
        BuildTree(2);
    }
}
